package com.xinhe.web.reposity;

import com.xinhe.web.entity.OrderAddress;
import com.xinhe.web.entity.OrderItem;
import com.xinhe.web.response.OrderAddressView;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.HashSet;
import java.util.List;

public interface OrderAddressRepository  extends JpaRepository<OrderAddress, Long> {

    @Query(value = "select * from tb_order_address where removed = 0 and f_order_id =?1 and type =?2", nativeQuery = true)
    OrderAddress findByOrderIdAndType(Long orderId, String type);
    @Query(value = "select * from tb_order_address where f_order_id=?1", nativeQuery = true)
    OrderAddressView findByGoodsOrderId(Long orderId);
}
